/*
 * Copyright (c) 2025 Huawei Technologies Co., Ltd.
 * openUBMC is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *         http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

#include <devmon/driver_abi.h>
#include <mc/engine.h>
#include <mc/log.h>
#include <new>
#include <string>

namespace devmon::test {
template <typename T>
using property = mc::engine::property<T>;

class test_device_interface : public mc::engine::interface<test_device_interface> {
public:
    MC_INTERFACE("bmc.dev.TestInterface")
    test_device_interface()  = default;
    ~test_device_interface() = default;
    property<std::string> DeviceName;
    property<uint8_t>     PortCount;
    property<uint8_t>     NetDevFuncType;
    property<std::string> MediumType;
};

class test_device : public mc::engine::object<test_device> {
public:
    MC_OBJECT(test_device, "test_device", "/bmc/dev/Systems/${SystemId}/test_device/${DeviceName}",
              (test_device_interface))
    test_device()  = default;
    ~test_device() = default;
    bool init(mc::mutable_dict& csr_object, const mc::dict& connector);
    bool start();
    bool stop();

    test_device_interface m_test_device_interface;
    property<uint8_t>     m_system_id;
};

class test_driver {
public:
    test_driver()  = default;
    ~test_driver() = default;
    device_driver_t* create(std::string& device_name);
};
} // namespace devmon::test
